#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from ._base import ApiConfig, AdminConfig

class LocalMixin(object):
    #线上外链
    SQLALCHEMY_DATABASE_URI = "mysql+pymysql://root:Linlong219@47.98.106.87:3306/domain?charset=utf8mb4"
    # SQLALCHEMY_DATABASE_URI = "mysql+pymysql://dev:123456@127.0.0.1:3306/yhdd?charset=utf8mb4"
    # SQLALCHEMY_DATABASE_URI = "mysql+pymysql://root:root@192.168.0.153:3306/yhdd?charset=utf8mb4"
    # SQLALCHEMY_DATABASE_URI = "mysql+pymysql://super_yhdd:Linlong219@rm-bp193z0m7lmk92b813o.mysql.rds.aliyuncs.com:3306/yhdd_dev?charset=utf8mb4"
    SQLALCHEMY_BINDS = {
        # 线上外链
        'yhdd': 'mysql+pymysql://root:Linlong219@47.98.106.87:3306/domain?charset=utf8mb4'
        # 'yhdd': 'mysql+pymysql://super_yhdd:Linlong219@rm-bp193z0m7lmk92b813o.mysql.rds.aliyuncs.com:3306/yhdd_dev?charset=utf8mb4'
        # 'yhdd': 'mysql+pymysql://super_yhdd:Linlong219@rm-bp193z0m7lmk92b813o.mysql.rds.aliyuncs.com:3306/yhdd?charset=utf8mb4'
        # 'rt': 'mysql+pymysql://super_yhdd:Linlong219@rm-bp193z0m7lmk92b813o.mysql.rds.aliyuncs.com:3306/rt?charset=utf8mb4'
    }

    RUN_ENV = 'local'
    DEBUG = True

    # SQLALCHEMY_DATABASE_URI = "mysql+pymysql://dev:123456@127.0.0.1:3306/car_park?charset=utf8"
    # SQLALCHEMY_BINDS = {
    #     'car_park': 'mysql+pymysql://dev:123456@127.0.0.1:3306/car_park?charset=utf8'
    # }
    # RUN_ENV = 'dev'
    # DEBUG = False

    REDIS_DB = 1
    REDIS_HOST = '127.0.0.1'
    REDIS_PORT = 6379

    LOGGERS = {
        'icp': {
            'level': 'INFO',
        },
    }

    MOBILE_ENABLE = False

    BABEL_DEFAULT_LOCALE = 'zh_CN'

    SECRET_KEY = '8c71fb3f7593543f2ad180d31148a7cf'
    INFORMATION_COLUMN_ID = 22

    # celery 配置
    CELERY_BROKER_URL = 'redis://localhost:6379'


class LocalApiConfig(LocalMixin, ApiConfig):
    pass


class LocalAdminConfig(LocalMixin, AdminConfig):
    # 禁止CSRF攻击检验
    WTF_CSRF_ENABLED = False
